home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / cat3 / CallDel.3 < prev    next >
Text File  |  1994-09-20  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4. Tcl_CallWhenDeleted(3)Tcl Library Procedures                  7.0
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted - Arrange for
  12.      callback when interpreter is deleted
  13.  
  14. SYNOPSIS
  15.      #include <tcl.h>
  16.  
  17.      Tcl_CallWhenDeleted(_i_n_t_e_r_p, _p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  18.  
  19.      Tcl_DontCallWhenDeleted(_i_n_t_e_r_p, _p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  20.  
  21. ARGUMENTS
  22.      Tcl_Interp             *_i_n_t_e_r_p      (in)      Interpreter
  23.                                                    with  which to
  24.                                                    associated
  25.                                                    callback.
  26.  
  27.      Tcl_InterpDeleteProc   *_p_r_o_c        (in)      Procedure   to
  28.                                                    call      when
  29.                                                    _i_n_t_e_r_p      is
  30.                                                    deleted.
  31.  
  32.      ClientData             _c_l_i_e_n_t_D_a_t_a   (in)      Arbitrary
  33.                                                    one-word value
  34.                                                    to   pass   to
  35.                                                    _p_r_o_c.
  36. _________________________________________________________________
  37.  
  38.  
  39. DESCRIPTION
  40.      Tcl_CallWhenDeleted  arranges  for  _p_r_o_c  to  be  called  by
  41.      Tcl_DeleteInterp  if/when  _i_n_t_e_r_p  is deleted at some future
  42.      time.  _P_r_o_c will be invoked just before the  interpreter  is
  43.      deleted, but the interpreter will still be valid at the time
  44.      of the call.  _P_r_o_c should have  arguments  and  result  that
  45.      match the type Tcl_InterpDeleteProc:
  46.           typedef int Tcl_InterpDeleteProc(
  47.                ClientData _c_l_i_e_n_t_D_a_t_a,
  48.                Tcl_Interp *_i_n_t_e_r_p);
  49.      The _c_l_i_e_n_t_D_a_t_a and  _i_n_t_e_r_p  parameters  are  copies  of  the
  50.      _c_l_i_e_n_t_D_a_t_a     and     _i_n_t_e_r_p     arguments     given     to
  51.      Tcl_CallWhenDeleted.  Typically,  _c_l_i_e_n_t_D_a_t_a  points  to  an
  52.      application-specific  data  structure that _p_r_o_c uses to per-
  53.      form cleanup when an interpreter is about to go away.   _P_r_o_c
  54.      does not return a value.
  55.  
  56.      Tcl_DontCallWhenDeleted   cancels   a   previous   call   to
  57.      Tcl_CallWhenDeleted  with  the  same arguments, so that _p_r_o_c
  58.      won't be called after all when _i_n_t_e_r_p is deleted.  If  there
  59.      is  no  deletion  callback  that  matches  _i_n_t_e_r_p, _p_r_o_c, and
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Tcl_CallWhenDeleted(3)Tcl Library Procedures                  7.0
  71.  
  72.  
  73.  
  74.      _c_l_i_e_n_t_D_a_t_a then the call to Tcl_DontCallWhenDeleted  has  no
  75.      effect.
  76.  
  77.  
  78. KEYWORDS
  79.      callback, delete, interpreter
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Tcl                                                             2
  130.  
  131.  
  132.  
  133.